import { Component, OnInit } from '@angular/core';
import { Observable } from "rxjs/Rx";
import { BladeData } from "../../../shared/blade/blade-data";
import { Blade } from "../../../shared/blade/blade.model";
import { BladeService } from "../../../shared/blade.service";
import { CalculateExpressionListComponent } from './calculate-expression-list/calculate-expression-list.component';
import { ToolbarService } from "../../../shared/toolbar.service";
import { SetofkeyService } from "../../../service/setofkey.service";
import { DialogService } from "../../../shared/dialog.service";
import { BladeContainerInterface } from "../../../shared/blade/blade-container.interface";

@Component({
  selector: 'app-calculate-expression',
  templateUrl: './calculate-expression.component.html',
  styleUrls: ['./calculate-expression.component.css'],
  providers: [BladeService]
})
export class CalculateExpressionComponent implements OnInit {

  /**
   * 当前弹出层
   * 
   * @type {Blade}
   * @memberof BladeContainerInterface
   */
  currentBlade: Blade;

  constructor(public bladeService: BladeService, ) { }

  ngOnInit() {
    this.createBlade();
  }

  /**
   * 创建风机线路列表弹出层
   * 
   * 
   * @memberof DicComponent
   */
  createBlade() {
    let data: BladeData = new BladeData();
    data.id = "ExpressionList";
    data.title = "电量公式";
    data.subtitle = "电量公式列表";
    data.isClosingDisabled = true;
    this.currentBlade = this.bladeService.createBlade(CalculateExpressionListComponent, data);
    this.bladeService.showBlade(this.currentBlade);
  }
  /**
   * 是否可以离开
   * 
   * 
   * @memberof DicComponent
   */
  canDeactivate(): boolean | Observable<boolean> | Promise<boolean> {
    return true;
  }

}



// WEBPACK FOOTER //
// ./src/app/module/basic/calculate-expression/calculate-expression.component.ts